let obj = {
  a: 1,
  b: {
    n: 2
  }
}

function clone(obj) {
  let clone = Object.create(obj)
  clone.c = 3
  clone.getA = function() {
    return this.a
  }
  return clone
}

let obj2 = clone(obj)

console.log(obj2.getA());


// let newObj = Object.create(obj)  // 1. {}   2. {}.__proto__ = obj
// let newObj2 = Object.create(obj)
// newObj.b.n = 20
// console.log(newObj2.b.n);
